﻿using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TeamSystem.Data.UnitTesting;
using Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions;

namespace Acms.SqlStoredProcedureTests
{
    [TestClass()]
    public class Site_GetAll : DatabaseTestClass
    {

        public Site_GetAll()
        {
            InitializeComponent();
        }

        [TestInitialize()]
        public void TestInitialize()
        {
            base.InitializeTest();
        }
        [TestCleanup()]
        public void TestCleanup()
        {
            base.CleanupTest();
        }

        #region Designer support code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction ExecuteProcedureTest_TestAction;
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Site_GetAll));
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.RowCountCondition acms_Site_GetAllTest_RowCount1;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction ExcludesDeleteTest_TestAction;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.RowCountCondition ExcludesDeleteGetAllRowCount;
            Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition ExcludeDelteRowCount;
            this.ExecuteProcedureTestData = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestActions();
            this.ExcludesDeleteTestData = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestActions();
            ExecuteProcedureTest_TestAction = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction();
            acms_Site_GetAllTest_RowCount1 = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.RowCountCondition();
            ExcludesDeleteTest_TestAction = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.DatabaseTestAction();
            ExcludesDeleteGetAllRowCount = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.RowCountCondition();
            ExcludeDelteRowCount = new Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.Conditions.ScalarValueCondition();
            // 
            // ExecuteProcedureTestData
            // 
            this.ExecuteProcedureTestData.PosttestAction = null;
            this.ExecuteProcedureTestData.PretestAction = null;
            this.ExecuteProcedureTestData.TestAction = ExecuteProcedureTest_TestAction;
            // 
            // ExecuteProcedureTest_TestAction
            // 
            ExecuteProcedureTest_TestAction.Conditions.Add(acms_Site_GetAllTest_RowCount1);
            resources.ApplyResources(ExecuteProcedureTest_TestAction, "ExecuteProcedureTest_TestAction");
            // 
            // acms_Site_GetAllTest_RowCount1
            // 
            acms_Site_GetAllTest_RowCount1.Enabled = true;
            acms_Site_GetAllTest_RowCount1.Name = "acms_Site_GetAllTest_RowCount1";
            acms_Site_GetAllTest_RowCount1.ResultSet = 1;
            acms_Site_GetAllTest_RowCount1.RowCount = 10;
            // 
            // ExcludesDeleteTestData
            // 
            this.ExcludesDeleteTestData.PosttestAction = null;
            this.ExcludesDeleteTestData.PretestAction = null;
            this.ExcludesDeleteTestData.TestAction = ExcludesDeleteTest_TestAction;
            // 
            // ExcludesDeleteTest_TestAction
            // 
            ExcludesDeleteTest_TestAction.Conditions.Add(ExcludeDelteRowCount);
            ExcludesDeleteTest_TestAction.Conditions.Add(ExcludesDeleteGetAllRowCount);
            resources.ApplyResources(ExcludesDeleteTest_TestAction, "ExcludesDeleteTest_TestAction");
            // 
            // ExcludesDeleteGetAllRowCount
            // 
            ExcludesDeleteGetAllRowCount.Enabled = true;
            ExcludesDeleteGetAllRowCount.Name = "ExcludesDeleteGetAllRowCount";
            ExcludesDeleteGetAllRowCount.ResultSet = 2;
            ExcludesDeleteGetAllRowCount.RowCount = 9;
            // 
            // ExcludeDelteRowCount
            // 
            ExcludeDelteRowCount.ColumnNumber = 1;
            ExcludeDelteRowCount.Enabled = true;
            ExcludeDelteRowCount.ExpectedValue = "1";
            ExcludeDelteRowCount.Name = "ExcludeDelteRowCount";
            ExcludeDelteRowCount.NullExpected = false;
            ExcludeDelteRowCount.ResultSet = 1;
            ExcludeDelteRowCount.RowNumber = 1;
        }

        #endregion


        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        #endregion


        [TestMethod()]
        public void ExecuteProcedureTest()
        {
            DatabaseTestActions testActions = this.ExecuteProcedureTestData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        [TestMethod()]
        public void ExcludesDeleteTest()
        {
            DatabaseTestActions testActions = this.ExcludesDeleteTestData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        private DatabaseTestActions ExecuteProcedureTestData;
        private DatabaseTestActions ExcludesDeleteTestData;
    }
}
